'''
Created on 2009-9-4

@author: LiPengYu
'''
import cherrypy    
from kid import load_template

def void(handler=None):
    def decorator(handler):
        return cherrypy.expose(handler)
    if handler==None:
        return decorator
    else:
        return cherrypy.expose(handler)

def kid(file):
    template_module = load_template(file, cache=1)
    def decorator(handler):
        def function(self, *para):
            return str(template_module.Template(*handler(self, *para)))
        return cherrypy.expose(function)
    return decorator
